package servlet;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by liujunnan on 2017/11/22.
 */
public class HelloServlet extends HttpServlet{

    public HelloServlet() {
        System.out.println("构造");
    }

    @Override
    public void init() throws ServletException {
        super.init();
        System.out.println("初始化");
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       System.out.println("处理get请求");
       PrintWriter out =response.getWriter();
       out.println("hello servlet111111");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        super.doPost(request, response);
    }
    public void destroy()
    {
        System.out.println("销毁");
    }

}
